package com.itheima.spring.ioc;

import com.itheima.spring.config.AppConfig;
import com.itheima.spring.service.MyService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAnnotationSpringIOC {

    public static void main(String[] args) {
        // 扫描注解的方式创建bean定义
        ApplicationContext ctx= new AnnotationConfigApplicationContext(AppConfig.class);
        MyService myService = ctx.getBean(MyService.class);
        myService.sayHello();

        new AnnotationConfigApplicationContext("");
    }


}
